import React from 'react';
import {Menu} from 'antd';
import {Link} from 'react-router';
import userStore from  '../store/userStore';

export default class NeedLogin extends React.Component {
    static contextTypes = {
      router: React.PropTypes.object
    }

    componentWillMount() {
      if (!userStore.user) {
        this.context.router.push('/login');
      }
    }

    render() {
      return (
        <div>
          {this.props.children}
        </div>
      )
    }
}
